import request from '@/utils/request'

/**
 * 获取工位自定义数据
 * @param getStationCustomData
 */
export function getStationCustomData(stations) {
  return request({
    url: `/md/commonCustomDatas/getStationCustomData`,
    method: 'get',
    params: stations
  })
}

/**
 * 查询工位数据弹出框
 * @param list
 */
export function selectPageStation(data) {
  return request({
    url: `/md/commonBrowsers/selectPageStation`,
    method: 'post',
    data
  })
}
/**
 * 查询产线数据弹出框
 * @param list
 */
export function selectPageProductLine(data) {
  return request({
    url: `/md/commonBrowsers/selectPageProductLine`,
    method: 'post',
    data
  })
}
/**
 * 查询工序数据弹出框
 * @param list
 */
export function selectPageOperation(data) {
  return request({
    url: `/md/commonBrowsers/selectPageOperation`,
    method: 'post',
    data
  })
}
/**
 * 通过工位查询数据
 * @param inquire
 */
export function inquireStations(stations) {
  return request({
    url: `/md/stations/query`,
    method: 'get',
    params: stations
  })
}
/**
 * 保存
 * @param save
 */
export function saveStations(data) {
  return request({
    url: `/md/stations/save`,
    method: 'post',
    data
  })
}

/**
 * 删除工位信息
 * @param delete
 */
export function deleteStations(stations) {
  return request({
    url: `/md/stations/delete`,
    method: 'get',
    params: stations
  })
}

/**
 * 查询用户未关联的工位信息
 * @param data
 */
export function queryUnConfigStation(data) {
  return request({
    url: `/md/stations/findUncorrelatedUserStations`,
    method: 'post',
    data
  })
}
/**
 * 查询用户已关联的工位信息
 * @param data
 */
export function queryConfigStation(data) {
  return request({
    url: `/md/stations/findUserStations`,
    method: 'post',
    data
  })
}

/**
 * 保存用户配置工位
 * @param data.stationBos []
 * @param data.userId ''
 */
export function saveConfigStation(data) {
  return request({
    url: `/system/iapSysUserT/saveUserStations`,
    method: 'put',
    data
  })
}
